<?php
/**
 * 初始化安装目录内容
 * CK 开发框架
 * User: Clake
 * Date: 16/9/7
 * Time: 10:32
 */
use CK\Util\IO\Directory;
use CK\Util\IO\File;

//检查库目录
if (!Directory::Exists(APP_LIB_PATH)) {
    Directory::Create(APP_LIB_PATH);
    Directory::Create(APP_LIB_PATH.'App/Site/Controller');
    Directory::Create(APP_LIB_PATH.'App/Site/Model');
    File::Copy(CK_PATH . 'demo/src/lib/App/Site/Controller/index.php', APP_LIB_PATH . 'App/Site/Controller/index.php');
    File::Copy(CK_PATH . 'demo/src/lib/App/Site/Module.php', APP_LIB_PATH . 'App/Site/Module.php');
}

//检查配置目录
if (!Directory::Exists(APP_CONF_PATH)) {
    Directory::Create(APP_CONF_PATH);
    File::Copy(CK_PATH . 'demo/src/config/main.conf.php', APP_CONF_PATH . 'main.conf.php');
}

//检查临时缓存目录
if (!Directory::Exists(APP_CACHE_PATH)) {
    Directory::Create(APP_CACHE_PATH);
}

//检查错误日志目录
if (!Directory::Exists(APP_LOG_PATH)) {
    Directory::Create(APP_LOG_PATH);
}
